package ck.com.api;

import ck.com.dto.Dto;
import ck.com.pojo.Specification;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

public interface SpecificationApi {


    @RequestMapping("getOneSingle")
    Dto<Specification> getSpecByName(@RequestParam(value="name") String name);

    @RequestMapping("getOneSpec")
    Dto<Specification> getOneSpec(@RequestParam(value = "id")Integer id);

    @RequestMapping("addNewSpec")
    Dto<Integer> addNewSpec(@RequestBody Map<String,Object> params);

    @RequestMapping("beforeDel")
    Dto<List<Specification>> beforeDel(@RequestParam(value = "specificationId") Integer specificationId);

    @RequestMapping("delSpec")
    Dto<Integer> delSpec(@RequestParam(value = "id") Integer id);

    @RequestMapping("updateSingle")
    Dto<Integer> updateSingle(@RequestParam(value = "name")String name,@RequestParam(value = "id")Integer id);
}

